feat(mobile): highlight and surface current user in suggested reviewers (port #2435)#2449
Open
Gilbert09 wants to merge 6 commits into
Open
feat(mobile): highlight and surface current user in suggested reviewers (port #2435)#2449Gilbert09 wants to merge 6 commits into
Gilbert09 wants to merge 6 commits into
Conversation
…rs (port #2435) Ports desktop PR #2435 to the mobile inbox report detail. - Wire the current user's uuid (via useUserQuery) into SuggestedReviewers so the existing isMe highlight shows. - Move the logged-in user to the front of the suggested-reviewers list when present and not already first, via a pure orderSuggestedReviewers util. - Add unit tests covering reorder, already-first no-op, absent user, and missing uuid. Generated-By: PostHog Code Task-Id: 6570d0da-5363-4355-94b2-4576776d02aa
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/mobile/src/features/inbox/utils.test.ts:33-49
The three no-op cases all assert the same thing — that the original array reference is returned unchanged — across different inputs. Per the team's convention of preferring parameterised tests, they're a natural fit for `it.each`.
```suggestion
it.each([
{
label: "already first",
reviewers: [reviewer("me", "uuid-me"), reviewer("a", "uuid-a")],
meUuid: "uuid-me" as string | null | undefined,
},
{
label: "absent",
reviewers: [reviewer("a", "uuid-a"), reviewer("b", "uuid-b")],
meUuid: "uuid-me" as string | null | undefined,
},
{
label: "null meUuid",
reviewers: [reviewer("a", "uuid-a"), reviewer("me", "uuid-me")],
meUuid: null as string | null | undefined,
},
{
label: "undefined meUuid",
reviewers: [reviewer("a", "uuid-a"), reviewer("me", "uuid-me")],
meUuid: undefined as string | null | undefined,
},
])("is a no-op when $label", ({ reviewers, meUuid }) => {
expect(orderSuggestedReviewers(reviewers, meUuid)).toBe(reviewers);
});
```
Reviews (1): Last reviewed commit: "feat(mobile): highlight and surface curr..." | Re-trigger Greptile |
Generated-By: PostHog Code Task-Id: 6570d0da-5363-4355-94b2-4576776d02aa
96308d0 to
d371697
Compare
Resolves the modify/rename conflict with main, which renamed inbox/[id].tsx to inbox/[...id].tsx. Generated-By: PostHog Code Task-Id: f65eb1e6-78ba-4c40-8077-b4cd78485c93
Temporarily matches main's inbox/[...id].tsx so the base branch merges cleanly; PR feature edits are re-applied after the merge. Generated-By: PostHog Code Task-Id: f65eb1e6-78ba-4c40-8077-b4cd78485c93
Re-applies the current-user highlighting/ordering edits to inbox/[...id].tsx on top of the merged base. Generated-By: PostHog Code Task-Id: f65eb1e6-78ba-4c40-8077-b4cd78485c93
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports desktop PR #2435 ("Highlight current user in signal suggested reviewers") to the mobile app, bringing the inbox report detail to parity.
Two gaps were closed in the mobile "Suggested reviewers" list:
useUserQueryand passes it asmeUuidto<SuggestedReviewers>, so the component's existingisMehighlight badge actually shows.orderSuggestedReviewersutil alongside the other inbox derivation helpers.The "Why was I assigned?" commit-reason tooltip from desktop is intentionally not ported: mobile's
SuggestedReviewersdoes not renderrelevant_commitsat all, and inventing a new commits UI was out of scope.Changes
apps/mobile/src/features/inbox/utils.ts— addorderSuggestedReviewers(reviewers, meUuid).apps/mobile/src/app/inbox/[id].tsx— calluseUserQuery, reorder in thesuggestedReviewersmemo, passmeUuidto the component.apps/mobile/src/features/inbox/utils.test.ts— unit tests for the reorder (moves to front, no-op when already first / absent / no uuid).Testing
pnpm --filter @posthog/mobile test src/features/inbox/— passing.tsc --noEmitclean for the changed files.apps/codeuntouched.